package fan.project1_SpeedTalkSystem.Mapper;

import fan.project1_SpeedTalkSystem.Model.UserInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {

    @Select("select * from user_info where user_name = #{userName}")
    UserInfo getUserInfoByName(String userName);

    @Select("select * from user_info where id = #{userId}")
    UserInfo getUserInfoById(Integer userId);

    @Insert("insert into user_info(user_name,password,github_url) values (#{userName},#{password},#{githubUrl})")
    Integer insertUser(UserInfo newUser);
}
